<div id="content">
  <div class="row s_page_title">
    <sa-big-breadcrumbs [items]="['设备安装管理', '待维修车辆']" icon="fa fa-wrench"
      class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
  </div>

  <sa-widgets-grid>
    <div class="s_table">
      <div sa-widget [editbutton]="false" color="darken" class="clearfix">
        <header>
          <span class="widget-icon"><i class="fa fa-table"></i></span>
          <h2>待维修车辆</h2>
        </header>
        <div>
          <div class="widget-body no-padding">
            <div class="page-header clearfix s_table_opreation">
              <div class="left page-header-btn" style="width: calc(100% - 220px)">
                <sa-company-tree-car companyTreeId="companyTree" [companyData]="companyData" [isShowCarSort]="true"
                  (companySelected)="companySelected($event)"></sa-company-tree-car>
                <div class="top_module">
                  <span class="module_text">省份</span>
                  <select name="" class="top_module_select" [(ngModel)]="provinceId">
                    <option value="">全部</option>
                    <option value="" *ngFor="let item of provinceList" [value]="item.id">{{ item.areaName }}</option>
                  </select>
                </div>
                <div class="top_module">
                  <span class="module_text">用户名</span>
                  <div class="s_hover_box">
                    <select class="select2" id="userNameSelect2" style="width: 150px">
                      <option value=""></option>
                    </select>
                    <div class="s_del_icon" (click)="delUserName()">x</div>
                  </div>
                </div>
                <div class="top_module top_module_box" style="min-width: auto">
                  <span class="top_module_label module_text">故障类型</span>
                  <select name="" class="top_module_select" [(ngModel)]="faultTypeName" style="min-width: 110px">
                    <option value="">全部</option>
                    <option value="" *ngFor="let item of faultTypeArr" [value]="item.text">{{ item.text }}</option>
                  </select>
                </div>
                <div class="top_module top_module_box" style="min-width: auto">
                  <span class="top_module_label module_text">进厂限制</span>
                  <select name="" class="top_module_select" [(ngModel)]="isPush" style="min-width: 110px">
                    <option value="">全部</option>
                    <option value="1">限制</option>
                    <option value="0">不限制</option>
                  </select>
                </div>
                <div class="top_module top_module_box" style="min-width: auto">
                  <span class="top_module_label module_text">故障状态</span>
                  <select name="" class="top_module_select" [(ngModel)]="repairedStatus" style="min-width: 110px">
                    <option value="">全部</option>
                    <option value="0">待维修</option>
                    <option value="1">已维修</option>
                  </select>
                </div>
                <div class="top_module top_module_box" style="min-width: auto">
                  <span class="top_module_label module_text">时间类型</span>
                  <select name="" class="top_module_select" [(ngModel)]="dateType" style="min-width: 110px">
                    <option value="">全部</option>
                    <option value="1">更新时间</option>
                    <option value="2">维修时间</option>
                    <option value="3">录入时间</option>
                    <option value="4">故障时间</option>
                  </select>
                </div>
                <div class="top_module top_module_box" style="min-width: auto">
                  <span class="top_module_label module_text">排序</span>
                  <select name="" class="top_module_select" [(ngModel)]="sortType" style="min-width: 110px">
                    <option value="1">升序</option>
                    <option value="2">降序</option>
                  </select>
                </div>
                <div class="top_module top_module_box" style="min-width: auto">
                  <span class="top_module_label module_text">服务到期</span>
                  <select name="" class="top_module_select" [(ngModel)]="serviceType" style="min-width: 110px"
                    [disabled]="selectedCompanyName?false:true">
                    <option value="">全部</option>
                    <option value="1">未到期</option>
                    <option value="2">已到期</option>
                  </select>
                </div>
                <div class="selectDate top_module">
                  <div class="input-daterange input-group s_selected_time_box s_hover_box">
                    <input type="text" [(ngModel)]="startTime" class="form-control s_selected_time" id="datetimepicker3"
                      autocomplete="off" placeholder="选择开始时间" />
                    <span class="s_selected_time_spe">至</span>
                    <input type="text" [(ngModel)]="endTime" class="form-control s_selected_time" id="datetimepicker4"
                      autocomplete="off" placeholder="选择结束时间" />
                    <div class="s_del_icon" (click)="del_date()">x</div>
                  </div>
                </div>

                <div class="top_module">
                  <span class="module_text">厂区运维负责人</span>
                  <div class="s_hover_box">
                    <select class="select2" id="operatorSelect2" style="width: 150px">
                      <option value=""></option>
                    </select>
                    <div class="s_del_icon" (click)="delOperator()">x</div>
                  </div>
                </div>

                <button class="btn btn-primary" (click)="table_search()">查询</button>
                <button type="button" class="btn btn-primary" (click)="new_fault()" *ngIf="resourceAdd">添加</button>
                <button type="button" class="btn btn-primary" (click)="carWaitingRepairTop(waitingRepairModal)">
                  车辆排名
                </button>
                <button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
                <button type="button" class="btn btn-primary" (click)="openRepairedRecord(repairedRecordModal)">
                  维修记录
                </button>
                <button type="button" class="btn btn-primary" (click)="questionSort(questionSortModal)">
                  故障分类
                </button>
                <button type="button" class="btn btn-primary" (click)="updata_device(lgModal)">批量进厂限制</button>
                <button type="button" class="btn btn-primary s_btn_fix" (click)="setFactoryOnline(factoryOnlineModal)">
                  进厂限制设置
                </button>
                <!-- <button type="button" class="btn btn-primary s_btn_fix" (click)="addRecordDetail(recordDetailModal)">新增不良记录</button> -->
                <!-- <button type="button" class="btn btn-primary" (click)="setHeader(headerModal)">设置表头</button> -->
                <button type="button" class="btn btn-primary" *ngIf="resourceImport"
                  (click)="showImportModal(weightModal)">
                  导入
                </button>
                <button type="button" class="btn btn-primary" *ngIf="resourceImport"
                  (click)="showCarOfflineModal(carOfflineModal)">
                  查看车辆离线地点
                </button>
                <button id="sensorWhitelistTriggerBtn" type="button" class="btn btn-primary"
                  (click)="handleSensorWhitelistClick(sensorWhiteList)">
                  传感器检测白名单
                </button>
              </div>
              <div class="right top-search">
                <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input"
                  placeholder="车牌号码、 所属公司..." />
                <span class="top-search-box">
                  <button class="top-search-btn" type="button" (click)="table_search()">
                    <i class="fa fa-search"></i>
                  </button>
                </span>
              </div>
            </div>
            <div class="table_scroll">
              <table
                class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                <thead>
                  <tr>
                    <!-- <th *ngFor="let row of faultList" [style.display]="row.isHide == '0' ? 'table-cell' : 'none'">
                      <div
                        *ngIf="row.fieldName == 'isChecked'"
                        class="checkbox"
                        style="margin: 0; left: 5px; text-align: center"
                      >
                        <label>
                          <input
                            type="checkbox"
                            class="checkbox style-0"
                            [(ngModel)]="allChecked"
                            (click)="allSelected()"
                          />
                          <span></span>
                        </label>
                      </div>
                      <span *ngIf="row.fieldName != 'isChecked' && row.fieldName != 'operation'">{{ row.field }}</span>
                      <span *ngIf="row.fieldName == 'operation' && (resourceEdit || resourceDeleteBatch)">操作</span>
                    </th> -->
                    <th>
                      <div class="checkbox" style="margin:0;left: 5px;text-align: center;">
                        <label>
                          <input type="checkbox" class="checkbox style-0" [(ngModel)]="allChecked"
                            (click)="allSelected()">
                          <span></span>
                        </label>
                      </div>
                    </th>
                    <th *ngIf="resourceEdit||resourceDeleteBatch">操作</th>
                    <!-- <th>维修前图片</th>
                    <th>维修后图片</th> -->
                    <th>车牌号码</th>
                    <th>所属公司</th>
                    <th>故障类型</th>
                    <th>维修人员</th>
                    <th>维修时间</th>
                    <!-- <th>响应时长</th> -->
                    <th>故障现象</th>
                    <!-- <th>维修记录</th>
										<th>维修总结</th>
										<th>GPS天线</th>
										<th>GSM天线</th> -->
                    <th>进厂限制</th>
                    <th>备注</th>
                    <th>故障状态</th>
                    <th>故障时间</th>
                    <th>录入人员</th>
                    <th>录入时间</th>
                    <th>最后编辑</th>
                    <th>司机电话</th>
                    <th>最后拨打人</th>
                    <th>最后拨打时间</th>
                    <th>最后通话时长</th>
                    <th>总拨打次数</th>
                    <th>设备ID</th>
                    <th>故障来源</th>
                    <th>维修指导</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i"
                    [ngClass]="{ selected: activeSelected === row.id }" (dblclick)="checkAbnormal(row)"
                    (click)="rowSelected(row, $event, i)">
                    <!--   <td
                      *ngFor="let item of faultList"
                      [ngClass]="item.fieldName == isChecked ? checkbox - td : ''"
                      [style.display]="item.isHide == '0' ? 'table-cell' : 'none'"
                    >
                      <div
                        *ngIf="item.fieldName == 'isChecked'"
                        class="checkbox"
                        style="margin: 0; left: 5px; text-align: center"
                      >
                        <label class="checkbox-label">
                          <input
                            type="checkbox"
                            class="checkbox style-0"
                            [(ngModel)]="row.isChecked"
                            (click)="rowSelected(row, $event, i)"
                          />
                          <span class="checkbox-flag"></span>
                        </label>
                      </div>
                      <div *ngIf="item.fieldName == 'operation' && (resourceEdit || resourceDeleteBatch)">
                        <button
                          type="button"
                          (click)="push_edit(row, pushEditModal)"
                          *ngIf="resourceEdit && row.repairedStatus == '0'"
                        >
                          推送APP
                        </button>
                        <button type="button" (click)="updata_fault(row)" *ngIf="resourceEdit">编辑</button>
                        <button type="button" (click)="del_fault(row)" *ngIf="resourceDeleteBatch">删除</button>
                      </div>
                      <div *ngIf="item.fieldName == 'beforeImageInfo' && row.beforeImageInfo">
                        <button
                          type="button"
                          (click)="open_img('before', row, ImgModal)"
                          *ngIf="row.beforeImageInfo.length > 0 && row.beforeImageInfo"
                        >
                          查看
                        </button>
                      </div>
                      <div *ngIf="item.fieldName == 'afterImageInfo' && row.afterImageInfo">
                        <button
                          type="button"
                          (click)="open_img('after', row, ImgModal)"
                          *ngIf="row.afterImageInfo.length > 0 && row.afterImageInfo"
                        >
                          查看
                        </button>
                      </div>
                      <div *ngIf="item.fieldName == 'isPush'">
                        <span *ngIf="row.isPush == '1'">限制</span>
                        <span *ngIf="row.isPush == '0' && !row.restrictTime">不限制</span>
                        <span *ngIf="row.restrictTime">
                          {{ row.restrictTime }}后开始限制
                          <button type="button" (click)="cancelRestrict(row)" *ngIf="row.restrictTimeFlag">
                            取消限制
                          </button>
                        </span>
                      </div>
                      <div *ngIf="item.fieldName == 'repairedStatus'">
                        <span *ngIf="row.repairedStatus == '0'" class="orange">待维修</span>
                        <span *ngIf="row.repairedStatus == '1'" class="green">已维修</span>
                      </div>
                      <div *ngIf="item.fieldName == 'payStatus'">
                        <span *ngIf="row.payStatus == '1'" class="orange">待支付</span>
                        <span *ngIf="row.payStatus == '2'" class="green">支付成功</span>
                        <span *ngIf="row.payStatus == '3'" class="red">订单取消</span>
                        <span *ngIf="row.payStatus == '4'" class="grey">已完成</span>
                      </div>
                      <div *ngIf="item.fieldName == 'callRecord'">
                        <button
                          type="button"
                          *ngIf="row.contactResult"
                          (click)="callRecordDetail(row, callRecordDetailModal)"
                        >
                          联系详情
                        </button>
                      </div>
                      <div
                        *ngIf="
                          item.fieldName != 'payStatus' &&
                          item.fieldName != 'callRecord' &&
                          item.fieldName != 'isChecked' &&
                          item.fieldName != 'beforeImageInfo' &&
                          item.fieldName != 'afterImageInfo' &&
                          item.fieldName != 'repairedStatus' &&
                          item.fieldName != 'isPush' &&
                          item.fieldName != 'operation'
                        "
                      >
                        {{ row[item.fieldName] }}
                      </div>
                    </td> -->
                    <td class="checkbox-td">
                      <div class="checkbox" style="margin:0;left: 5px;text-align: center;">
                        <label class="checkbox-label">
                          <input type="checkbox" class="checkbox style-0" [(ngModel)]="row.isChecked"
                            (click)='rowSelected(row,$event,i)'>
                          <span class="checkbox-flag"></span>
                        </label>
                      </div>
                    </td>
                    <td *ngIf="resourceEdit||resourceDeleteBatch">
                      <button type="button" (click)="push_edit(row, pushEditModal)"
                        *ngIf="resourceEdit && row.repairedStatus == '0'">推送APP</button>
                      <button type="button" (click)="updata_fault(row)" *ngIf="resourceEdit">编辑</button>
                      <button type="button" (click)="del_fault(row)" *ngIf="resourceDeleteBatch">删除</button>
                    </td>
                    <!-- <td>
                      <span *ngIf="row.beforeImageInfo">
                        <button type="button" (click)="open_img('before',row,ImgModal)" *ngIf="row.beforeImageInfo.length > 0 && row.beforeImageInfo">查看</button>
                      </span>
                    </td>
                    <td>
                      <span *ngIf="row.afterImageInfo">
                        <button type="button" (click)="open_img('after',row,ImgModal)" *ngIf="row.afterImageInfo.length > 0 && row.afterImageInfo">查看</button>
                      </span>
                    </td> -->
                    <td>{{row.carNumber}}</td>
                    <td>{{row.companyName}}</td>
                    <td>{{row.faultTypeName}}</td>
                    <td>{{row.repairedUser}}</td>
                    <td>{{row.repairedTime}}</td>
                    <!-- <td>{{row.responseTime}}</td> -->
                    <td>{{row.faultPhenomenon}}</td>
                    <!-- <td>{{row.repairedRecords}}</td>
										<td>{{row.repairedConclusion}}</td>
										<td>{{row.gpsAntenna}}</td>
										<td>{{row.gsmAntenna}}</td> -->
                    <td>
                      <span *ngIf="row.isPush == '1'">限制</span>
                      <span *ngIf="row.isPush == '0' && !row.restrictTime">不限制</span>
                      <span *ngIf="row.restrictTime">
                        {{ row.restrictTime }}后开始限制
                        <button type="button" (click)="cancelRestrict(row)" *ngIf="row.restrictTimeFlag">
                          取消限制
                        </button>
                      </span>
                    </td>
                    <td>{{row.remark}}</td>
                    <td>
                      <span *ngIf="row.repairedStatus == '0'" class="orange">待维修</span>
                      <span *ngIf="row.repairedStatus == '1'" class="green">已维修</span>
                    </td>
                    <td>{{row.faultTime}}</td>
                    <td>{{row.creater}}</td>
                    <td>{{row.createTime}}</td>
                    <td>{{row.lastUpdateTime}}</td>
                    <td>{{row.driverPhone}}</td>
                    <td>{{row.callUser?row.callUser:''}}</td>
                    <td>{{row.callUser?row.callTime:''}}</td>
                    <td>{{row.callUser?row.callDuration:''}}</td>
                    <td>{{row.callUser?row.callCount:''}}</td>
                    <td>{{row.deviceId}}</td>
                    <td>{{row.updateSource}}</td>
                    <td>{{row.repairedGuide}}</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="table-fix clearfix">
              <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
                (onPageChange)="paginate($event)"></paginator>
              <button type="button" class="btn default refresh_btn" (click)="refresh()">
                <i class="fa fa-refresh"></i>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </sa-widgets-grid>
  <!-- 待维修车辆TOP20   弹窗-->
  <section bsModal #waitingRepairModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 780px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(waitingRepairModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">
            车辆故障TOP{{ topNumber }}
            <button type="button" class="btn btn-primary" (click)="waitingRepairTopExport()"
              style="float: right; padding: 4px 12px; margin-right: 28px">
              导出
            </button>
            <div class="btn_ground" style="min-width: 160px; float: right; margin-right: 60px">
              <button class="btn_color" [ngClass]="{ active: curBtn === '1' }" (click)="topDateSelect('1')">
                今天
              </button>
              <button class="btn_color" [ngClass]="{ active: curBtn === '2' }" (click)="topDateSelect('2')">
                近一周
              </button>
              <button class="btn_color" [ngClass]="{ active: curBtn === '3' }" (click)="topDateSelect('3')">
                当月
              </button>
            </div>
            <div class="page-header page-header-btn" style="float: right; margin: 0; padding: 0; border: none">
              <div class="top_module top_module_box right" style="margin: 0">
                <span class="top_module_label module_text">TOP{{ topNumber }}排名</span>
                <select name="" class="top_module_select" [(ngModel)]="topNumber" (change)="topNumberChange()"
                  style="min-width: 32px">
                  <option value="10">10</option>
                  <option value="20">20</option>
                  <option value="30">30</option>
                  <option value="40">40</option>
                  <option value="50">50</option>
                </select>
              </div>
            </div>
          </h4>
        </div>
        <div class="modal-body">
          <div class="row form-horizontal table_scroll">
            <div style="border: 1px solid #ddd; border-radius: 4px; padding: 12px; margin-bottom: 8px" *ngIf="
                selectedCompanyName || userName || faultTypeName || repairedStatus || searchKey || startTime || endTime
              ">
              <ul class="row">
                <li style="font-size: 14px; font-weight: bold; margin-bottom: 4px">筛选条件</li>
                <li class="col-sm-4" *ngIf="selectedCompanyName">
                  <span>公司名称：</span>
                  <span>{{ selectedCompanyName }}</span>
                </li>
                <li class="col-sm-4" *ngIf="userName">
                  <span>用户名：</span>
                  <span>{{ userName }}</span>
                </li>
                <li class="col-sm-4" *ngIf="faultTypeName">
                  <span>故障类型：</span>
                  <span>{{ faultTypeName }}</span>
                </li>
                <li class="col-sm-4" *ngIf="repairedStatus">
                  <span>故障状态：</span>
                  <span *ngIf="repairedStatus == '0'">待维修</span>
                  <span *ngIf="repairedStatus == '1'">已维修</span>
                </li>
                <li class="col-sm-4" *ngIf="startTime">
                  <span>开始时间：</span>
                  <span>{{ startTime }}</span>
                </li>
                <li class="col-sm-4" *ngIf="endTime">
                  <span>结束时间：</span>
                  <span>{{ endTime }}</span>
                </li>
                <li class="col-sm-4" *ngIf="searchKey">
                  <span>关键字：</span>
                  <span>{{ searchKey }}</span>
                </li>
                <li class="col-sm-4" *ngIf="topNumber">
                  <span>top排名：</span>
                  <span>前{{ topNumber }}名</span>
                </li>
              </ul>
            </div>
            <table *ngIf="waitingRepairCarTopList.length > 0"
              class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
              <tr>
                <th>排名</th>
                <th>车牌号码</th>
                <th>厂区</th>
                <th>问题[个]</th>
                <th>详情</th>
              </tr>
              <tr *ngFor="let item of waitingRepairCarTopList; let i = index">
                <td>{{ i + 1 }}</td>
                <td>{{ item.carNumber }}</td>
                <td>{{ item.companyName }}</td>
                <td>{{ item.num }}</td>
                <td>
                  <button type="button" (click)="faultDetail(waitingRepairModal, item, startTime, endTime)">
                    查看
                  </button>
                </td>
              </tr>
            </table>
            <div class="note" *ngIf="waitingRepairCarTopList.length == 0">暂无数据</div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 待维修车辆TOP20 end-->
  <!-- 图片查看   弹窗-->
  <section bsModal #ImgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="imgClose(ImgModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">{{ imageType }}图片</h4>
        </div>
        <div class="modal-body" style="max-height: 520px; overflow: auto">
          <!-- <div class="row form-horizontal">
						<div class="img_desc">
							<div class="big_img_box">
								<img [src]="modal.active" alt="图片" class="picture"/>
							</div>
							<ul class="small_img_box">
								<li class="pre_arrow arrow" [ngClass]="{notAllow:modal.activeNum == 0}">
									<img src="assets/img/zuojiantou.png" (click)="change_img_left()" />
								</li>
								<li class="small_img" *ngFor="let item of modal.picture;let i = index" [ngClass]="{active:modal.activeNum == i}">
									<img [src]="item" (mouseover)="switch_img(i)" class="img" />
								</li>
								<li class="next_arrow arrow" [ngClass]="{notAllow:modal.activeNum == modal.picture.length-1}">
									<img src="assets/img/youjiantou.png" (click)="change_img_right($event)"/>
								</li>
							</ul>
						</div>
					</div> -->
          <div class="row form-horizontal imagesInfo" *ngIf="imagesInfo.length != 0">
            <div class="imagesList imagesList-sensor">
              <div *ngFor="let item of imagesInfo" class="imagesInfoFile">
                <div class="imgFileList">
                  <label class="imgTitle">{{ item.title }}</label>
                  <div class="imgContList">
                    <div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(row)">
                      <img class="imgSrc" [src]="row" [alt]="item.title" />
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 图片查看 弹窗end-->
  <!--<calendar-widget></calendar-widget>-->
  <!-- 图片查看   弹窗-->
  <section bsModal #repairedRecordModal="bs-modal" class="modal" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content" style="width: 530px">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeRepairedRecord(repairedRecordModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">维修记录</h4>
        </div>
        <div class="modal-body" style="padding: 0">
          <div class="row form-horizontal" style="height: 500px">
            <sa-calendar [initCalendarFlag]="isOpenCalendar"></sa-calendar>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 图片查看 弹窗end-->

  <!--折线图-->
  <div style="background: white; border-radius: 5px; margin-top: 5px; position: relative" [hidden]="!isChartView">
    <button (click)="closeChart()" class="div_closeBtn">×</button>
    <div class="widget-body no-padding" style="margin: 0">
      <div class="page-header clearfix s_table_opreation" style="margin: 0">
        <div class="left page-header-btn" style="padding: 5px">
          <div class="top_module">
            <span class="module_text" style="background: none">异常数据折线图</span>
          </div>
          <div style="display: inline-block">
            <div>
              <div class="selectDate top_module">
                <table-select-date [notInit]="true" [specifyTime]="specifyTime"
                  (outerTime)="getSelectChartTime($event)"></table-select-date>
              </div>
              <button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>

              <button type="button" class="btn btn-primary" (click)="singleLimitPush(lgModal)">
                {{ echartLimitTitle }}
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div style="display: flex">
      <sa-chart-bmap style="flex-grow: 1" [height]="420" [offDatas]="true" [inputParams]="selectedRow"
        [isBaiduMap]="true" (outerSend)="runParent($event)" (outerIsMap)="showMapView($event)" [isAuditData]="false"
        [isShowModify]="false"></sa-chart-bmap>

      <!-- 标记设备状态 -->
      <div style="width: 36%; border: 1px solid #ccc; border-radius: 4px; padding: 10px; height: 420px; overflow: auto"
        id="deviceStatusModuleBox">
        <div style="width: 348px" class="deviceStatusModule">
          <div class="form-group group" style="white-space: nowrap">
            <div style="margin-top: 4px">
              <div class="inline_block" (click)="sensorSelectAllClick()" style="margin-left: 10px">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': sensorSelectAll.selected }"></span>
                <span style="font-weight: bold">{{ sensorSelectAll.text }}</span>
              </div>
              <div (click)="allSensorKeepValue()" class="lisItem right" style="margin-right: 8px; margin-left: 0">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': isAllStraight }"></span>
                <span>传感器全部平直</span>
              </div>
            </div>
            <div>
              <div class="clearfix">
                <ul>
                  <li *ngFor="let item of sensorModuleList" class="table_scroll"
                    style="padding-left: 8px; margin-top: 8px; overflow: visible">
                    <button class="btn-link" title="单个传感器问题提交" (click)="updateSensorProblem(item)">
                      更新
                    </button>
                    <span class="channel-style bg-green sensorModuleFront" [ngClass]="{ 'bg-normal': !item.flag }">
                      {{ item.value }}
                      <i class="channel-style sensorFront front" *ngIf="item.isFront == '1'">前</i>
                      <i class="channel-style sensorFront bottom" *ngIf="item.isFront == '2'">后</i>
                    </span>
                    <div class="inline_block" style="margin-left: 4px; margin-top: 5px">
                      <div *ngFor="let lis of item.child" (click)="sensorLisSelected(item.value, lis.code)"
                        class="lisItem" style="margin-right: 8px; margin-left: 0">
                        <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': lis.selected }"></span>
                        <span>{{ lis.text }}</span>
                      </div>
                    </div>
                    <div style="font-size: 12px" *ngIf="item.selected && item.startTime && item.endTime">
                      <div class="item-box inline_block">
                        <span class="item-key"></span>
                        <span class="item-value" [attr.title]="">{{ item.operator }}</span>
                      </div>
                      <div class="item-box inline_block">
                        <span class="item-key"></span>
                        <span class="item-value" [attr.title]="">{{ item.startTime }} 至 {{ item.endTime }}</span>
                      </div>
                      <button class="btn-link" title="问题区间曲线、轨迹" (click)="dataDrawEchartBMap(item)">
                        查看
                      </button>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </div>
          <div class="borderdiv"></div>
          <div class="form-group group" style="white-space: nowrap">
            <div style="margin-bottom: 8px">
              <div class="inline_block" (click)="GPSSelectAllClick()" style="margin-left: 10px">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': GPSSelectAll.selected }"></span>
                <span style="font-weight: bold">{{ GPSSelectAll.text }}</span>
              </div>
            </div>
            <button class="btn-link" title="GPS问题提交" (click)="updateGPSProblem()" style="margin-left: 8px">
              更新
            </button>
            <div class="inline_block" id="gpsCheckboxList">
              <div *ngFor="let lis of GPSModuleList" (click)="GPSLisSelected(lis.code)" class="lisItem self-xs-45">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': lis.selected }"></span>
                <span>{{ lis.text }}</span>
              </div>
            </div>
            <div style="font-size: 12px; margin-left: 8px"
              *ngIf="GPSProblemList.selected && GPSProblemList.startTime && GPSProblemList.endTime">
              <div class="item-box inline_block">
                <span class="item-key"></span>
                <span class="item-value" [attr.title]="">{{ GPSProblemList.operator }}</span>
              </div>
              <div class="item-box inline_block">
                <span class="item-key"></span>
                <span class="item-value" [attr.title]="">
                  {{ GPSProblemList.startTime }} 至 {{ GPSProblemList.endTime }}
                </span>
              </div>
              <button class="btn-link" title="问题区间曲线、轨迹" (click)="dataDrawEchartBMap(GPSProblemList)">
                查看
              </button>
            </div>
          </div>
          <div class="borderdiv" style="margin-top: 2px"></div>
          <div class="form-group group" style="padding: 0 12px">
            <div class="inline_block">
              <div class="inline_block" (click)="deviceOfflineClick()">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': deviceOffline.selected }"></span>
                <span>{{ deviceOffline.text }}</span>
              </div>
            </div>
            <div class="inline_block" style="margin-left: 5px">
              <div class="inline_block" (click)="deviceContactClick()">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': deviceContact.selected }"></span>
                <span>{{ deviceContact.text }}</span>
              </div>
            </div>
            <div class="inline_block" style="margin-left: 5px">
              <div class="inline_block" (click)="deviceRepairedIspushClick()">
                <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': deviceRepairedIspush.selected }"></span>
                <span>{{ deviceRepairedIspush.text }}</span>
              </div>
            </div>
          </div>
          <div class="borderdiv"></div>
          <div>
            <button type="button" class="btn btn-primary" (click)="addDeviceRepaired()" style="margin-bottom: 10px">
              添加维修记录
            </button>
            <button type="button" class="btn btn-primary" (click)="updataDeviceStatus()"
              style="margin-right: 10px; margin-bottom: 10px">
              更新设备状态
            </button>
            <button type="button" class="btn btn-primary" (click)="editDeviceInfo(editDeciceModal)"
              style="margin-bottom: 10px">
              编辑设备信息
            </button>
          </div>
          <div class="borderdiv"></div>
          <div class="form-group">
            <div style="font-weight: bold; padding: 6px 10px">算法问题</div>
            <div *ngFor="let lis of algorithmQuestionList" (click)="algorithmLisSelected(lis.text)"
              class="lisItem col-xs-4" style="min-width: 100px; float: left; margin-left: 0px; margin-bottom: 10px">
              <span class="el-checkbox__inner" [ngClass]="{ 'is-checked': lis.selected }"></span>
              <span style="color: #333">{{ lis.text }}</span>
            </div>
          </div>
          <div class="form-group" style="clear: both; padding-left: 10px; padding-top: 5px">
            <button type="button" class="btn btn-primary" (click)="updataOrderStatus()">算法问题提交</button>
          </div>
        </div>
      </div>
      <!-- 标记设备状态结束 -->
    </div>

    <div [hidden]="!isMapView">
      <sa-bmap-chart [trackParams]="drawTrackArr" [isShowBmap]="isMapView"></sa-bmap-chart>
    </div>
  </div>

  <!--编辑设备信息  弹窗-->
  <section bsModal #editDeciceModal="bs-modal" class="modal" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(editDeciceModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">编辑设备信息</h4>
        </div>
        <div class="modal-body">
          <div class="row form-horizontal">
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">
                用途
                <sup>*</sup>
              </label>
              <div class="col-sm-9">
                <div class="clearfix s_fix_select2">
                  <select class="form-control select2" id="useTypeSelect" select2 name="carUseType" style="width: 100%">
                    <option value="">请选择</option>
                    <optgroup *ngFor="let item of carTypeList" [label]="item.label">
                      <option *ngFor="let itemChild of item.children" [value]="itemChild.id">
                        {{ itemChild.label }}
                      </option>
                    </optgroup>
                  </select>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">传感器类型</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <sa-sensor-type (sensorSelected)="sensorSelected($event)" Width="100%"
                    [sensorTypeId]="page.sensorType" Height="32px" [isShow]="false" type="1" [inputParam]="inputParam"
                    [isSendRequest]="false"></sa-sensor-type>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">传感器数量</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <input class="form-control" id="sensorAmount" name="sensorAmount" type="text"
                    [(ngModel)]="page.sensorAmount" placeholder="传感器数量" />
                </div>
              </div>
            </div>
            <div class="form-group sensorCH">
              <label class="control-label col-sm-2 no-padding-right">传感器</label>
              <div class="col-sm-9">
                <div style="border: 1px solid #ccc; padding-bottom: 8px; padding-left: 12px">
                  <div>
                    <label class="checkbox-inline" *ngFor="let item of deviceSensorArr">
                      <input type="checkbox" class="checkbox style-0" [value]="item.id" [name]="item.text"
                        [(ngModel)]="item.checked" (change)="deviceSensorChange(item.id, $event)" />
                      <span>{{ item.text }}</span>
                    </label>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-sm-2 no-padding-right">通道[前轴]</label>
              <div class="col-sm-9">
                <div class="passWay1">
                  <div *ngFor="let item of sensorAxleFront" style="display: inline-block; width: auto; height: auto">
                    <span *ngIf="item.checked" class="wayChannel wayCheck"
                      (click)="sensorAxleFrontChange(item, $event)">
                      {{ item.text }}
                    </span>
                    <span *ngIf="item.isDisable" class="wayChannel wayDisable">{{ item.text }}</span>
                    <span *ngIf="!item.isDisable && !item.checked" class="wayChannel"
                      (click)="sensorAxleFrontChange(item, $event)">
                      {{ item.text }}
                    </span>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-sm-2 no-padding-right">通道[后轴]</label>
              <div class="col-sm-9">
                <div class="passWay2">
                  <div *ngFor="let item of sensorAxleAfter" style="display: inline-block; width: auto; height: auto">
                    <span *ngIf="item.checked" class="wayChannel wayCheck"
                      (click)="sensorAxleAfterChange(item, $event)">
                      {{ item.text }}
                    </span>
                    <span *ngIf="item.isDisable" class="wayChannel wayDisable">{{ item.text }}</span>
                    <span *ngIf="!item.isDisable && !item.checked" class="wayChannel"
                      (click)="sensorAxleAfterChange(item, $event)">
                      {{ item.text }}
                    </span>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">车轴数量</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <input class="form-control" name="carAxleAmount" id="carAxleAmount" type="text"
                    [(ngModel)]="page.carAxleAmount" placeholder="车轴数量"
                    (input)="carAxleAmountChange($event.target.value)" />
                </div>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-sm-2 no-padding-right">安装位置</label>
              <div class="col-sm-9">
                <div class="install">
                  <div class="install-contain" *ngIf="page.carAxleAmount != 0 || page.carAxleAmount == ''">
                    <table
                      class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                      <thead>
                        <tr class="install-header">
                          <th></th>
                          <th>左</th>
                          <th>中</th>
                          <th>右</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr *ngFor="let row of installArray; let i = index" [attr.data-index]="i">
                          <td>轴{{ row.index }}</td>
                          <td>
                            <div class="installDiv install-L">
                              <span *ngFor="let channel of row.positionLMR[0].sensorChannel" class="mayChannel">
                                {{ channel }}
                                <i (click)="cancelChannel(row.index, 'left', channel)">x</i>
                              </span>
                              <span class="add" (click)="addinstall(row.index, 'left', installModal)">+</span>
                            </div>
                          </td>
                          <td>
                            <div class="installDiv install-M">
                              <span *ngFor="let channel of row.positionLMR[1].sensorChannel" class="mayChannel">
                                {{ channel }}
                                <i (click)="cancelChannel(row.index, 'middle', channel)">x</i>
                              </span>
                              <span class="add" (click)="addinstall(row.index, 'middle', installModal)">+</span>
                            </div>
                          </td>
                          <td>
                            <div class="installDiv install-R">
                              <span *ngFor="let channel of row.positionLMR[2].sensorChannel" class="mayChannel">
                                {{ channel }}
                                <i (click)="cancelChannel(row.index, 'right', channel)">x</i>
                              </span>
                              <span class="add" (click)="addinstall(row.index, 'right', installModal)">+</span>
                            </div>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">GPS天线</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <select class="form-control" name="gpsAntenna" [(ngModel)]="page.gpsAntenna" style="width: 100%"
                    (change)="gpsAntennaChange($event.target.value)">
                    <option value="">请选择</option>
                    <option *ngFor="let gpsObj of gpsOptions" [value]="gpsObj.value">{{ gpsObj.text }}</option>
                  </select>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">GSM天线</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <select class="form-control" name="gsmAntenna" [(ngModel)]="page.gsmAntenna" style="width: 100%"
                    (change)="gsmAntennaChange($event.target.value)">
                    <option value="">请选择</option>
                    <option *ngFor="let gsmObj of gsmOptions" [value]="gsmObj.value">{{ gsmObj.text }}</option>
                  </select>
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">司机姓名</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <input class="form-control" name="driverName" type="text" [(ngModel)]="page.driverName"
                    placeholder="司机姓名" />
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="control-label col-sm-2 no-padding-right">司机电话</label>
              <div class="col-sm-9">
                <div class="clearfix">
                  <input class="form-control" name="phone" type="text" [(ngModel)]="page.phone" placeholder="司机电话" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="closeModal(editDeciceModal)">取消</button>
          <button type="button" class="btn btn-primary" (click)="submitEditDeciceModal(editDeciceModal)">提交</button>
        </div>
      </div>
    </div>
  </section>
  <!--编辑设备信息  弹窗  end-->
  <!--折线图end-->

  <!-- 问题车辆分类  弹窗-->
  <section bsModal #questionSortModal="bs-modal" class="modal" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 860px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(questionSortModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">故障分类</h4>
        </div>
        <div class="modal-body">
          <div class="row form-horizontal">
            <div class="tabbable">
              <ul class="nav nav-tabs" id="myTab"
                style="padding-left: 12px; background-image: linear-gradient(#f1f5fd, #e9f0ff)">
                <li class="active s-lis">
                  <a data-toggle="tab" href="#repaired">
                    故障统计
                    <span id="allOrders" style=""></span>
                  </a>
                </li>
                <li class="s-lis">
                  <a data-toggle="tab" href="#question">
                    故障分类统计
                    <span id="transOrders" class="status-blue"></span>
                  </a>
                </li>
              </ul>
              <div class="tab-content" style="padding: 0; border: none">
                <div id="repaired" class="tab-pane active">
                  <div style="border: 1px solid #ddd; border-radius: 4px; padding: 12px; margin-top: 6px" *ngIf="
                      selectedCompanyName ||
                      carNumber ||
                      userName ||
                      faultTypeName ||
                      isPush ||
                      repairedStatus ||
                      searchKey ||
                      startTime ||
                      endTime ||
                      dateType
                    ">
                    <ul class="row">
                      <li style="font-size: 14px; font-weight: bold; margin-bottom: 4px">筛选条件</li>
                      <li class="col-sm-4" *ngIf="selectedCompanyName">
                        <span>公司名称：</span>
                        <span>{{ selectedCompanyName }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="carNumber">
                        <span>车牌号码：</span>
                        <span>{{ carNumber }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="userName">
                        <span>用户名：</span>
                        <span>{{ userName }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="faultTypeName">
                        <span>故障类型：</span>
                        <span>{{ faultTypeName }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="isPush">
                        <span>进厂限制：</span>
                        <span *ngIf="isPush == 0">限制</span>
                        <span *ngIf="isPush == 1">不限制</span>
                      </li>
                      <li class="col-sm-4" *ngIf="repairedStatus">
                        <span>维修状态：</span>
                        <span *ngIf="repairedStatus == 0">待维修</span>
                        <span *ngIf="repairedStatus == 1">已维修</span>
                      </li>
                      <li class="col-sm-4" *ngIf="dateType">
                        <span>时间类型：</span>
                        <span *ngIf="dateType == 1">创建时间</span>
                        <span *ngIf="dateType == 2">维修时间</span>
                        <span *ngIf="dateType == 3">录入时间</span>
                      </li>
                      <li class="col-sm-4" *ngIf="startTime">
                        <span>开始时间：</span>
                        <span>{{ startTime }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="endTime">
                        <span>结束时间：</span>
                        <span>{{ endTime }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="searchKey">
                        <span>关键字：</span>
                        <span>{{ searchKey }}</span>
                      </li>
                    </ul>
                  </div>
                  <table
                    class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                    <tr>
                      <th>名称</th>
                      <th *ngFor="let item of dataRepaireTotalList">{{ item.name }}</th>
                    </tr>
                    <tr>
                      <td>数值</td>
                      <td *ngFor="let item of dataRepaireTotalList">{{ item.value }}</td>
                    </tr>
                  </table>
                  <div id="repairedPieChart" style="width: 818px; height: 400px"></div>
                </div>
                <div id="question" class="tab-pane">
                  <div style="border: 1px solid #ddd; border-radius: 4px; padding: 12px; margin-top: 6px" *ngIf="
                      selectedCompanyName ||
                      carNumber ||
                      userName ||
                      faultTypeName ||
                      isPush ||
                      repairedStatus ||
                      searchKey ||
                      startTime ||
                      endTime ||
                      dateType
                    ">
                    <ul class="row">
                      <li style="font-size: 14px; font-weight: bold; margin-bottom: 4px">筛选条件</li>
                      <li class="col-sm-4" *ngIf="selectedCompanyName">
                        <span>公司名称：</span>
                        <span>{{ selectedCompanyName }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="carNumber">
                        <span>车牌号码：</span>
                        <span>{{ carNumber }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="userName">
                        <span>用户名：</span>
                        <span>{{ userName }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="faultTypeName">
                        <span>故障类型：</span>
                        <span>{{ faultTypeName }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="isPush">
                        <span>进厂限制：</span>
                        <span *ngIf="isPush == 0">不限制</span>
                        <span *ngIf="isPush == 1">限制</span>
                      </li>
                      <li class="col-sm-4" *ngIf="repairedStatus">
                        <span>维修状态：</span>
                        <span *ngIf="repairedStatus == 0">待维修</span>
                        <span *ngIf="repairedStatus == 1">已维修</span>
                      </li>
                      <li class="col-sm-4" *ngIf="dateType">
                        <span>时间类型：</span>
                        <span *ngIf="dateType == 1">创建时间</span>
                        <span *ngIf="dateType == 2">维修时间</span>
                        <span *ngIf="dateType == 3">录入时间</span>
                      </li>
                      <li class="col-sm-4" *ngIf="startTime">
                        <span>开始时间：</span>
                        <span>{{ startTime }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="endTime">
                        <span>结束时间：</span>
                        <span>{{ endTime }}</span>
                      </li>
                      <li class="col-sm-4" *ngIf="searchKey">
                        <span>关键字：</span>
                        <span>{{ searchKey }}</span>
                      </li>
                    </ul>
                  </div>
                  <table
                    class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                    <tr>
                      <th>问题点</th>
                      <th *ngFor="let item of dataAbnormalCarTotalList">{{ item.name }}</th>
                    </tr>
                    <tr>
                      <td>次数</td>
                      <td *ngFor="let item of dataAbnormalCarTotalList">{{ item.value }}</td>
                    </tr>
                  </table>
                  <div id="questionPieChart" style="width: 818px; height: 400px"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 问题车辆分类end-->

  <!--  批量进厂限制-->
  <div bsModal #lgModal="bs-modal" id="lgModal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="lgModalhide(lgModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">批量进厂限制</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <form class="form" role="form">
              <div class="row" style="margin-bottom: 10px">
                <div class="form-group">
                  <label class="control-label">是否批量进厂限制：</label>
                  <div class="inline_block">
                    <label class="radio radio-inline" style="vertical-align: inherit">
                      <input type="radio" class="radiobox" name="0" value="0" [(ngModel)]="lgisPush" />
                      <span>不限制</span>
                    </label>
                    <label class="radio radio-inline" style="vertical-align: inherit">
                      <input type="radio" class="radiobox" name="1" value="1" [(ngModel)]="lgisPush" />
                      <span>限制</span>
                    </label>
                    <label class="radio radio-inline" style="vertical-align: inherit">
                      <input type="radio" class="radiobox" name="time" value="time" [(ngModel)]="lgisPush" />
                      <span>
                        自定义限制[
                        <span *ngIf="isPushTime == 6">默认</span>
                        <span>{{ isPushTime }}</span>
                        小时后进行限制]
                      </span>
                    </label>
                    <input type="number" *ngIf="lgisPush == 'time'" οnkeyup="value=value.replace(/[^\d]/g,'')"
                      (change)="inputChange()" name="isPushTime" placeholder="默认6小时" [(ngModel)]="isPushTime"
                      style="width: 84px; padding: 0 12px" />
                  </div>
                </div>

                <!--<div class="form-group" *ngIf="lgisPush == '0'">
                                    <label class="control-label">是否下次进厂限制：</label>
                                    <div class="inline_block">
                                        <label class="radio radio-inline" style="vertical-align:inherit;">
                                            <input type="radio" class="radiobox" name="6" value="6" [(ngModel)]="isPushTime" (change)="resetChange($event.target.checked,'Y')">
                                            <span>限制[默认6小时后进行限制]</span>
                                        </label>
                                        <label class="radio radio-inline"  style="vertical-align:inherit;">
                                            <input type="radio" class="radiobox" name="style-0a" value="" [(ngModel)]="isPushTime" (change)="resetChange($event.target.checked,'N')">
                                            <span>不限制</span>
                                        </label>
                                    </div>
                                </div>-->
              </div>
            </form>
          </div>
        </div>
        <div style="width: 60%; display: inline-block; position: absolute; bottom: 16px; left: 12px">
          <p style="color: #ccc">
            <span>【说明】</span>
            <span>自定义限制：设置时间[小时]后，车辆进厂限制生效，没有生效之前车辆允许进厂。</span>
          </p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="lgModalhide(lgModal)">取消</button>
          <button type="button" class="btn btn-primary" (click)="autoReset(lgModal)">确认</button>
        </div>
      </div>
    </div>
  </div>
  <!--弹窗end-->

  <!--  极光推送APP-->
  <div bsModal #pushEditModal="bs-modal" id="pushEditModal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="pushEditModalhide(pushEditModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">推送APP</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <form class="form form-inline" role="form">
              <div class="row">
                <div class="form-group clearfix" style="width: 100%">
                  <label class="control-label col-sm-3 no-padding-right" style="line-height: 30px">推送人</label>
                  <div class="col-sm-8 inline_block s_hover_box">
                    <select class="select2" id="pushUserNameSelect2" style="width: 90%">
                      <option value=""></option>
                    </select>
                    <div class="s_del_icon" (click)="delPushUserName()" style="right: 15%">x</div>
                  </div>
                </div>
                <p style="margin-top: 20px">提示：如果没选择推送人，将默认推送给该维修点的负责人</p>
              </div>
            </form>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="pushEditModalhide(pushEditModal)">取消</button>
          <button type="button" class="btn btn-primary" (click)="pushEditReset(pushEditModal)">确认</button>
        </div>
      </div>
    </div>
  </div>
  <!--弹窗end-->

  <!-- 进厂限制设置 -->
  <div bsModal #factoryOnlineModal="bs-modal" id="factoryOnlineModal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 1000px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(factoryOnlineModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">取消进厂限制</h4>
        </div>
        <div class="modal-body" style="padding: 15px">
          <div class="page-header clearfix s_table_opreation"
            style="margin-top: 0px; margin-bottom: 15px; padding-bottom: 15px">
            <div class="left page-header-btn">
              <div class="top_module">
                <span class="module_text">选择厂区</span>
                <sa-company-tree companyTreeId="company4" (companySelected)="onlinecompanySelected($event)"
                  [companyParentList]="companyParentList"></sa-company-tree>
              </div>

              <button type="button" class="btn btn-primary" (click)="factory_table_search()">查询</button>
              <button type="button" class="btn btn-primary" (click)="factoryAdd(addFactoryModal, 'new')">添加</button>
            </div>
            <div class="right top-search">
              <input type="text" id="factoryOnlineSearch" [(ngModel)]="factoryOnlineSearchKey"
                (change)="factory_table_search()" class="search-input" placeholder="公司名称" />
              <span class="top-search-box">
                <button class="top-search-btn" type="button" (click)="factory_table_search()">
                  <i class="fa fa-search"></i>
                </button>
              </span>
            </div>
          </div>
          <div class="table_scroll">
            <table
              class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
              <thead>
                <tr>
                  <th>公司名称</th>
                  <th>进厂限制[维修记录]</th>
                  <th>进厂限制[设备警报]</th>
                  <th>时间段</th>
                  <th>操作人</th>
                  <th>操作时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <tr *ngFor="let row of factoryOnlineTableData; let i = index" [attr.data-index]="i"
                  [ngClass]="{ selected: row.isChecked }">
                  <td>{{ row.companyName }}</td>
                  <td>
                    <span *ngIf="row.isRepaired === 0">进厂限制</span>
                    <span *ngIf="row.isRepaired === 1">取消限制</span>
                    <!-- {{row.isRepaired}} -->
                  </td>
                  <td>
                    <span *ngIf="row.isAlarm === 0">进厂限制</span>
                    <span *ngIf="row.isAlarm === 1">取消限制</span>
                    <!-- {{row.isAlarm}} -->
                  </td>
                  <td>{{ row.periodTime }}</td>
                  <td>{{ row.operator }}</td>
                  <td>{{ row.operatingTime }}</td>
                  <td>
                    <button type="button" (click)="editFactory(row, addFactoryModal, 'update')">编辑</button>
                    <button type="button" (click)="delFactory(row)">删除</button>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="table-fix clearfix">
            <paginator [totalRecords]="factoryOnlinetotalCount" [rows]="factoryOnlinePageSize"
              [currentPage]="factoryOnlineCurPage - 1" (onPageChange)="factoryPaginate($event)"></paginator>
            <button type="button" class="btn default refresh_btn" (click)="factoryTableRefresh()">
              <i class="fa fa-refresh"></i>
            </button>
          </div>
          <div class="shuoming" style="position: relative">
            <div style="width: 50%; display: inline-block">
              <p><span style="color: red">说明：</span></p>
              <p style="padding-left: 25px">1、根据配置的时间段，数据API接口取消厂限制;</p>
              <p style="padding-left: 25px">2、维修记录：取消维修记录的进厂限制;</p>
              <p style="padding-left: 25px">3、设备警报：取消离线警报的进厂限制（设备离线的状态不会更改）</p>
            </div>
            <div style="display: inline-block; width: 40%; margin-left: 20px; position: absolute; top: 0">
              <p><span style="color: red">添加规则：</span></p>
              <p style="padding-left: 30px">1、每个厂区只能保存一条记录；</p>
              <p style="padding-left: 30px">2、父厂区添加后，子厂区不能再添加；</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 进厂限制设置 end-->
  <!-- 添加和编辑厂区 -->
  <section bsModal #addFactoryModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" id="addFactoryModal">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeFactory(addFactoryModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 *ngIf="fromType == 'new'" class="modal-title">添加-取消进厂限制</h4>
          <h4 *ngIf="fromType == 'update'" class="modal-title">编辑-取消进厂限制</h4>
        </div>
        <div class="modal-body">
          <form id="setFactoryFrom" class="form-horizontal" role="form" novalidate="novalidate"
            [saBootstrapValidator]="factoryvalidatorOptions">
            <div class="row form-horizontal">
              <div class="form-group clearfix">
                <label class="control-label col-sm-4 no-padding-right">
                  公司名称：
                  <sup>*</sup>
                </label>
                <div class="col-sm-8" (click)="onclickSelectCompany()">
                  <input class="form-control" *ngIf="fromType == 'update'" name="selectCompanyName" disabled
                    [(ngModel)]="factory.companyName" id="selectCompanyName" />
                  <sa-company-tree [ngStyle]="{ display: fromType == 'new' ? 'block' : 'none' }" inputName="companyName"
                    [Height]="32" [companyNameValue]="factory.companyName" [companyIdValue]="factory.companyId"
                    companyTreeId="companyTree7" (companySelected)="factorySelected($event)"
                    [companyParentList]="companyParentList"></sa-company-tree>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="control-label col-sm-4 no-padding-right">
                  时间段：
                  <sup>*</sup>
                </label>
                <div class="col-sm-8">
                  <div class="clearfix input_lis">
                    <input class="form-control s_input" name="selfTimeInputId" type="text" onfocus="this.blur()"
                      (click)="isShowTimer()" [(ngModel)]="selfTimeInputId" id="selfTimeInput" placeholder="请选择时间段" />
                    <div class="s_del_icon" (click)="delSelfTime()">x</div>
                  </div>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="control-label col-sm-4 no-padding-right">
                  进厂限制[维修记录]：
                  <sup>*</sup>
                </label>
                <div class="col-sm-8">
                  <div class="clearfix" *ngIf="factory.isRepaired === 0">
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="record" value="1" (click)="clickRecord(1)" />
                      取消限制
                    </label>
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="record" value="0" (click)="clickRecord(0)" checked />
                      进厂限制
                    </label>
                  </div>
                  <div class="clearfix" *ngIf="factory.isRepaired === 1">
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="record" value="1" (click)="clickRecord(1)" checked />
                      取消限制
                    </label>
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="record" value="0" (click)="clickRecord(0)" />
                      进厂限制
                    </label>
                  </div>
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="control-label col-sm-4 no-padding-right">
                  进厂限制[设备警报]：
                  <sup>*</sup>
                </label>
                <div class="col-sm-8">
                  <div class="clearfix" *ngIf="factory.isAlarm === 0">
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="warning" value="1" (click)="clickWarning(1)" />
                      取消限制
                    </label>
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="warning" value="0" (click)="clickWarning(0)"
                        checked />
                      进厂限制
                    </label>
                  </div>
                  <div class="clearfix" *ngIf="factory.isAlarm === 1">
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="warning" value="1" (click)="clickWarning(1)"
                        checked />
                      取消限制
                    </label>
                    <label class="col-sm-4" style="margin-bottom: 0px">
                      <input type="radio" class="radioSales" name="warning" value="0" (click)="clickWarning(0)" />
                      进厂限制
                    </label>
                  </div>
                </div>
              </div>
              <div class="s_timePicker" id="s_timePicker">
                <div class="s_arrow"></div>
                <div class="s_start">
                  <p class="s_title">
                    开始时间
                    <span>
                      -[
                      <span style="color: #1a6ddd; font-size: 14px">{{ startTimeSelected }}</span>
                      ]
                    </span>
                  </p>
                  <div class="s_border_box">
                    <ul>
                      <li class="s_lis" *ngFor="let item of hourList" (click)="selectedTime(item.index, 'start')">
                        {{ item.index }}
                      </li>
                    </ul>
                  </div>
                </div>
                <div class="s_end">
                  <p class="s_title">
                    结束时间
                    <span>
                      -[
                      <span style="color: #1a6ddd; font-size: 14px">{{ endTimeSelected }}</span>
                      ]
                    </span>
                  </p>
                  <div class="s_border_box">
                    <ul>
                      <li class="s_lis" *ngFor="let item of hourList" (click)="selectedTime(item.index, 'end')">
                        {{ item.index }}
                      </li>
                    </ul>
                  </div>
                </div>
                <div class="s_time_footer">
                  <button class="btn btn-default" (click)="isShowTimer()" style="padding: 4px 12px; min-width: 40px">
                    取消
                  </button>
                  <button class="btn btn-primary s_btn_primary" (click)="submitTimerSelected()"
                    style="padding: 4px 12px; min-width: 40px">
                    确认
                  </button>
                </div>
              </div>
            </div>
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="closeFactory(addFactoryModal)">取消</button>
          <button type="button" *ngIf="!factory.id" class="btn btn-primary" (click)="addSubmitFactory(addFactoryModal)">
            提交
          </button>
          <button type="button" *ngIf="factory.id" class="btn btn-primary" (click)="editSubmitFactory(addFactoryModal)">
            提交
          </button>
        </div>
      </div>
    </div>
  </section>
  <!-- 添加厂区  结束 -->
  <!-- 表头弹窗 -->
  <section bsModal #headerModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content" style="width: 800px">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeHeader(headerModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">设置表头管理</h4>
        </div>
        <div class="modal-body" style="height: 500px; overflow: auto">
          <table
            class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
            <thead>
              <tr>
                <th>序号</th>
                <th>字段名称</th>
                <th style="text-align: center">是否隐藏</th>
                <th style="text-align: center">操作</th>
              </tr>
            </thead>
            <tbody class="tbodyHeader">
              <tr *ngFor="let item of faultPopupList">
                <td>{{ item.order }}</td>
                <td>{{ item.field }}</td>
                <td class="smart-form" style="padding: 7px 10px; text-align: center">
                  <input style="margin-right: 5px; display: none" name="status" class="isStatus" type="checkbox"
                    [checked]="item.isStatus" [attr.key]="item.fieldName" />
                </td>
                <td class="CBtn">
                  <span class="MoveUp" [ngClass]="{ hiddenMove: item.order == 1 }" (click)="MoveClick(item, '1')">
                    上移
                  </span>
                  <span class="MoveDown" [ngClass]="{ hiddenMove: item.order == faultList.length }"
                    (click)="MoveClick(item, '2')">
                    下移
                  </span>
                  <span class="MoveTop" [ngClass]="{ hiddenMove: item.order == 1 }" (click)="MoveClick(item, '3')">
                    置顶
                  </span>
                  <span class="MoveBottom" [ngClass]="{ hiddenMove: item.order == faultList.length }"
                    (click)="MoveClick(item, '4')">
                    置底
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="closeHeader(headerModal)">取消</button>
          <button type="button" class="btn btn-primary" (click)="recoveryHeader()">重置</button>
          <button type="button" class="btn btn-primary" (click)="submitHeader(headerModal)">提交</button>
        </div>
      </div>
    </div>
  </section>
  <!-- 添加厂区  结束 -->

  <!--    弹窗 不良记录 新增-->
  <section bsModal #recordDetailModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 1000px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="recordDetailClose(recordDetailModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">新增不良记录</h4>
        </div>
        <div class="modal-body" style="min-height: 240px; max-height: 560px">
          <div class="row form-horizontal">
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">
                  寄回时间：
                  <sup>*</sup>
                </label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.returnTime" name="returnTime"
                    id="returnTime" autocomplete="off" placeholder="寄回时间" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">复测结果：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.retestResult"
                    name="retestResult" placeholder="复测结果" />
                </div>
              </div>
            </div>
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">车牌号：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" disabled [(ngModel)]="recordDetailFrom.carNumber"
                    name="carNumber" placeholder="车牌号" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">不良原因：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.badReasons" name="badReasons"
                    placeholder="不良原因" />
                </div>
              </div>
            </div>
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">公司名称：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" disabled [(ngModel)]="recordDetailFrom.companyName"
                    name="companyName" placeholder="公司名称" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">改善策略：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.improvementStrategy"
                    name="improvementStrategy" placeholder="改善策略" />
                </div>
              </div>
            </div>
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">
                  设备ID：
                  <sup>*</sup>
                </label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" disabled [(ngModel)]="recordDetailFrom.deviceId"
                    name="deviceId" placeholder="设备ID" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">问题解决时间：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.resolutionTime"
                    name="resolutionTime" placeholder="问题解决时间" />
                </div>
              </div>
            </div>
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">
                  产品编号(外壳编码)：
                </label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.productNo" name="productNo"
                    placeholder="产品编号(外壳编码)" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">问题负责人：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.principal" name="principal"
                    placeholder="问题负责人" />
                </div>
              </div>
            </div>
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">硬件版本号：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.hwVersion" name="hwVersion"
                    placeholder="硬件版本号" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">
                  故障现象：
                  <sup>*</sup>
                </label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" disabled [(ngModel)]="recordDetailFrom.faultPhenomenon"
                    name="faultPhenomenon" placeholder="故障现象" />
                </div>
              </div>
            </div>
            <div class="form-group col-sm-12">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">生产日期：</label>
                <div class="col-xs-9">
                  <input class="form-control" type="text" [(ngModel)]="recordDetailFrom.productTime" name="productTime"
                    id="productTime" autocomplete="off" placeholder="生产日期" />
                </div>
              </div>
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">关联维修记录：</label>
                <div class="col-xs-9">
                  <select class="form-control" name="type" [ngModel]="recordDetailFrom.relation" style="width: 100%"
                    disabled>
                    <option value="0">未关联</option>
                    <option value="1">已关联</option>
                  </select>
                </div>
              </div>
              <!-- <div class="col-sm-6 col-xs-12">
							<label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0;">不良图片(多图上传)：</label>
							<div class="col-xs-9" >
								<input class="form-control" type="text"  [(ngModel)]='recordDetailFrom.imagePaths' name='imagePaths' placeholder="不良图片"/>
							</div>
						</div> -->
            </div>
            <div class="form-group col-sm-12" style="margin-bottom: 0px">
              <div class="col-sm-6 col-xs-12">
                <label class="control-label col-xs-2 no-padding-right" style="padding: 7px 0 0">
                  不良图片(多图上传)：
                </label>
                <div class="col-xs-10 imgFileList">
                  <div class="imgFileList-power">
                    <div class="imgFileList-multifile">
                      <div class="uploadlocation uploadlocation1">
                        <div class="content-list">
                          <div class="headImg" *ngFor="let item of imageInfoList; let i = index">
                            <div class="contentImg"><img class="img" [src]="item" (click)="bigImgClick(item)" /></div>
                            <i class="deleteImg" (click)="deleteImg(i)"></i>
                          </div>
                          <div class="btn div_imgall">
                            <div class="div_shuline"></div>
                            <div class="div_hengline"></div>
                            <input type="file" class="up" title=" " placeholder=" " accept="image/*" multiple
                              (change)="multifileChange($event.target.files)" />
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-sm-6 col-xs-12" *ngIf="recordDetailFrom.relation == '1'">
                <label class="control-label col-xs-3 no-padding-right" style="padding: 7px 0 0">维修细分：</label>
                <div class="col-xs-9">
                  <textarea class="form-control" type="text" style="resize: vertical"
                    [(ngModel)]="recordDetailFrom.repairSubdivideStr" name="repairSubdivideStr" placeholder="维修细分"
                    disabled></textarea>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="recordDetailClose(recordDetailModal)">取消</button>
          <button type="button" class="btn btn-primary" (click)="recordDetailSubmit(recordDetailModal)">确认</button>
        </div>
      </div>
    </div>
  </section>
  <!--  弹窗end-->
  <!-- 拨打电话详情   弹窗-->
  <section bsModal #callRecordDetailModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 780px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(callRecordDetailModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">联系详情</h4>
        </div>
        <div class="modal-body">
          <div class="row form-horizontal table_scroll">
            <table
              class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
              <tr>
                <!--<th>车牌号码</th>
                                <th>所属公司</th>
                                <th>故障类型</th>-->
                <th>拨打人</th>
                <th>拨打时间</th>
                <th>通话时长</th>
                <th>联系结果</th>
                <th>备注</th>
              </tr>
              <tr *ngFor="let item of callRecordDetailList; let i = index">
                <!--<td>{{item.carNumber}}</td>
                                <td>{{item.companyName}}</td>
                                <td>{{item.faultTypeName}}</td>-->
                <td>{{ item.userName }}</td>
                <td>{{ item.callTime }}</td>
                <td>{{ item.callDuration }}</td>
                <td>{{ item.contactResult }}</td>
                <td>{{ item.remark }}</td>
              </tr>
            </table>
            <div class="table-fix clearfix">
              <paginator [totalRecords]="callRecordTotalCount" [rows]="callRecordPageSize"
                [currentPage]="callRecordCurPage - 1" (onPageChange)="callRecordPaginate($event)"></paginator>
              <button type="button" class="btn default refresh_btn" (click)="loadCallRecord()">
                <i class="fa fa-refresh"></i>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 拨打电话详情 end-->
  <!-- 导入弹框 -->
  <div bsModal #weightModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="cancelUp(weightModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">上传Excel文件</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <form class="form form-inline" role="form">
              <!-- <div class="row" style="margin-bottom: 24px;">
						<div class="form-group module_line">
							<button type="button" class="btn btn-primary" (click)="load_module()">下载模板</button>
							<span class="row" class="note">注：请先下载模板，采用模板编辑文件后上传</span>
						</div>
					</div> -->

              <div class="row">
                <div class="col-sm-10" style="padding: 0">
                  <div class="clearfix module_line">
                    <button type="button" class="btn btn-primary" style="width: 120px">
                      上传模板文件
                      <input type="file" class="up" (change)="fileChange($event.target.files)" name="fileToUpload"
                        (click)="clearFile()" [(ngModel)]="fileUp" type="file" placeholder="" />
                    </button>
                    <span class="row" class="note">注：格式excel</span>
                  </div>
                </div>
              </div>
              <div *ngIf="fileToUpload">
                <label class="control-label col-sm-1"></label>
                <div>
                  <ul>
                    <li class="file_list">
                      <i class="fa fa-file-text-o" style="margin-right: 12px"></i>
                      {{ fileToUpload.name }}
                      <i class="fa fa-check-circle green" style="margin-left: 60px"></i>
                    </li>
                  </ul>
                </div>
              </div>
            </form>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" (click)="cancelUp(weightModal)">取消</button>
          <button type="button" class="btn btn-primary" (click)="submitData(weightModal)">确认</button>
        </div>
      </div>
    </div>
  </div>
  <!-- 导入弹框 结束 -->

  <!-- 查看车辆离线地点弹框 -->
  <div bsModal #carOfflineModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 1000px; margin-top: 100px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="cancelCarOfflineModal(carOfflineModal)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">查看车辆离线地点</h4>
        </div>
        <div class="modal-body">
          <div id="allmap" style="height: 700px"></div>
        </div>
      </div>
    </div>
  </div>
  <!-- 查看车辆离线地点弹框 结束 -->


  <!-- 传感器白名单列表 -->
  <div bsModal #sensorWhiteList="bs-modal" id="sensorWhiteList" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="sensorWhiteLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 1000px">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(sensorWhiteList)" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 id="sensorWhiteLabel" class="modal-title">传感器检测白名单</h4>
        </div>
        <div class="modal-body" style="padding: 15px">
          <div class="page-header clearfix s_table_opreation"
            style="margin-top: 0px; margin-bottom: 15px; padding-bottom: 15px">
            <div class="left page-header-btn">
              <div class="top_module">
                <span class="module_text">公司名称</span>
                <sa-company-tree companyTreeId="company5" (companySelected)="onSensorWhitelistSelected($event)"
                  [companyParentList]="companyParentList"></sa-company-tree>
              </div>

              <div class="top_module" style="min-width: auto">
                <span class="module_text">状态</span>
                <select class="top_module_select" [(ngModel)]="sensorWhitelistParams.status">
                  <option value="">全部</option>
                  <option value="0">生效</option>
                  <option value="1">失效</option>
                </select>
              </div>

              <div class="selectDate top_module">
                <div class="input-daterange input-group s_selected_time_box s_hover_box">
                  <input type="text" [(ngModel)]="sensorWhitelistParams.startTime" class="form-control s_selected_time"
                    id="sensorWhitelistDatepicker1" autocomplete="off" placeholder="选择开始时间" />
                  <span class="s_selected_time_spe">至</span>
                  <input type="text" [(ngModel)]="sensorWhitelistParams.endTime" class="form-control s_selected_time"
                    id="sensorWhitelistDatepicker2" autocomplete="off" placeholder="选择结束时间" />
                  <div class="s_del_icon" (click)="delSensorDate()">x</div>
                </div>
              </div>

              <div class="top_module">
                <span class="module_text">模糊搜索</span>
                <input type="text" class="module_inp" [(ngModel)]="sensorWhitelistParams.searchKey"
                  placeholder="车牌号码/设备编号" />
              </div>

              <button type="button" class="btn btn-primary" (click)="whitelistRequest()">查询</button>
              <button type="button" class="btn btn-primary"
                (click)="handleWhitelistAddClick(sensorBypassModal)">添加</button>
              <button type="button" class="btn btn-primary" (click)="handleSensorWhitelistExport()">导出</button>
            </div>
            <div class="right">
            </div>
          </div>
          <div class="table_scroll">
            <table
              class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
              <thead>
                <tr>
                  <th>状态</th>
                  <th>车牌号码</th>
                  <th>设备编号</th>
                  <th>取消时长[天]</th>
                  <th>描述</th>
                  <th>更新时间</th>
                  <th>更新人员</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <tr *ngFor="let row of sensorWhitelistTableData; let i = index" [attr.data-index]="i">
                  <td>
                    <span *ngIf="row.status === 0">生效</span>
                    <span *ngIf="row.status === 1">失效</span>
                  </td>
                  <td>{{row.carNumber}}</td>
                  <td>{{row.deviceId}}</td>
                  <td><span *ngIf="row.status === 0">{{row.cancelTime || '长期'}}</span></td>
                  <td>{{ row.describe }}</td>
                  <td>{{ row.updateTime }}</td>
                  <td>{{ row.updateUser }}</td>
                  <td>
                    <button type="button" (click)="handleSensorBypassSetting( sensorBypassModal, row)">编辑</button>
                    <button type="button" (click)="cancelSensorWhitelist(row)">取消</button>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="table-fix clearfix">
            <paginator [totalRecords]="whitelistTotal" [rows]="whitelistPageSize" [currentPage]="whitelistCurPage - 1"
              (onPageChange)="whitelistPaginate($event)"></paginator>
            <button type="button" class="btn default refresh_btn" (click)="whitelistRequest()">
              <i class="fa fa-refresh"></i>
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 传感器白名单列表 end-->


  <!-- 添加传感器检测白名单-->
  <div bsModal #sensorBypassModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="sensorBypassModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" id="sensorBypassModal">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" (click)="closeModal(sensorBypassModal)" aria-label="Close"><span
              aria-hidden="true">&times;</span></button>

          <h4 class="modal-title">添加传感器检测白名单</h4>
        </div>
        <div class="modal-body">
          <form id="setFrequencyFrom" class="form-horizontal" role="form" novalidate="novalidate"
            [saBootstrapValidator]="sensorBypassValidatorOptions">
            <div class="row form-horizontal">
              <div [ngClass]="{hidden: !isSensorWhitelistCreate}" class="form-group">
                <label class="col-md-2 control-label">车牌号码</label>
                <div class="col-sm-9">
                  <div class="s_hover_box" style="width:100%">
                    <select class="select2" name="deviceId" id="sensorBypassSelect" style="width:100%">
                      <option value=''></option>
                    </select>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">白名单时长<sup>*</sup></label>
                <div class="col-sm-9">
                  <div class="inline_block">
                    <label class="radio radio-inline" style="vertical-align: inherit">
                      <input type="radio" class="radiobox" name="status" value="1"
                        [(ngModel)]="sensorBypassModel.status" (change)="handleSersonBypassStatusChange()" />
                      <span>长期</span>
                    </label>
                    <label class="radio radio-inline" style="vertical-align: inherit">
                      <input type="radio" class="radiobox" name="status" value="2"
                        [(ngModel)]="sensorBypassModel.status" />
                      <span>自定义天数</span>
                    </label>
                    <label class="radio radio-inline" style="vertical-align: inherit">
                      <input type="radio" class="radiobox" name="status" value="3"
                        [(ngModel)]="sensorBypassModel.status" (change)="handleSersonBypassStatusChange()" />
                      <span>
                        取消白名单
                      </span>
                    </label>
                  </div>
                </div>
              </div>

              <div *ngIf="sensorBypassModel.status == '2'" class="form-group">
                <div class="col-md-2"></div>
                <div class="col-sm-9 clearfix">
                  <input class="form-control" name="days" type="number" οnkeyup="value=value.replace(/[^\d]/g,'')"
                    (change)="sensorBypassInputChange()" placeholder="请输入自定义天数" [(ngModel)]="sensorBypassModel.days"
                    style="width: 200px; padding: 0 12px" />
                </div>
              </div>

              <div class="form-group clearfix">
                <label class="control-label col-sm-2 no-padding-right">白名单原因</label>
                <div class="col-sm-9">
                  <div class="clearfix">
                    <input class="form-control" name="describe" [(ngModel)]='sensorBypassModel.describe' type="text"
                      placeholder="填写白名单原因" />
                  </div>
                </div>
              </div>

            </div>
          </form>

        </div>
        <div class="modal-footer sensor-bypass-footer">
          <div style="width:350px">
            说明：添加白名单后，该车辆不进行传感器检测，直至取消白名单
          </div>
          <div style="width: 210px;">
            <button type="button" class="btn btn-default" (click)="closeModal(sensorBypassModal)">取消</button>
            <button type="button" class="btn btn-primary" (click)="editSensorBypassModal(sensorBypassModal)">提交</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 添加传感器检测白名单 结束 -->
</div>
<style type="text/css">
  /* 取消自动频率弹框 footer */
  .sensor-bypass-footer {
    text-align: unset;
    display: flex;
    justify-content: space-between;
  }

  .btn_ground .active {
    color: #1a6ddd;
    font-size: 16px;
    font-weight: bold;
  }

  .btn_color {
    background-color: #fff;
    margin-right: 12px;
    height: 24px;
    line-height: 24px;
    border: none;
    min-width: 46px;
    text-decoration: underline;
  }

  .btn_color:hover {
    color: #1a6ddd;
    font-size: 16px;
    font-weight: bold;
  }

  /* 弹出层 */
  .small_img_box {
    text-align: center;
    padding: 12px 0;
  }

  .picture {
    min-height: 100px;
    width: 100%;
    height: auto;
  }

  .img_desc .arrow {
    display: inline-block;
    cursor: pointer;
    vertical-align: top;
    height: 80px;
    line-height: 80px;
    padding: 0 15px;
  }

  .img_desc .arrow.notAllow {
    cursor: not-allowed;
  }

  .small_img {
    width: 80px;
    height: 80px;
    overflow: hidden;
    display: inline-block;
    border: 2px solid #ccc;
  }

  .small_img.active {
    border: 2px solid #1a6ddd;
  }

  .small_img:hover {
    border: 2px solid #1a6ddd;
  }

  .small_img .img {
    width: 100%;
    height: auto;
  }

  .radioSales {
    margin: 8px 8px 0 0;
    /* padding-top: 29px; */
    position: relative;
    top: 1px;
  }

  /* 表头管理弹窗样式 */
  .CBtn {
    text-align: center;
  }

  .CBtn span {
    padding: 5px 8px;
    margin-right: 10px;
    font-size: 12px;
    border-radius: 5px;
    color: #fff;
    cursor: -webkit-grab;
  }

  .CBtn .MoveUp {
    color: #da3120;
    border: 1px solid #da3120;
    background: #fff;
    /* background: #da3120ba; */
  }

  .CBtn .MoveUp:hover {
    background: #da3120;
    color: #fff;
  }

  .CBtn .MoveDown {
    color: #4caf50;
    border: 1px solid #4caf50;
    background: #fff;
  }

  .CBtn .MoveDown:hover {
    background: #4caf50;
    color: #fff;
  }

  .CBtn .MoveTop {
    /* background: #ac20daba; */
    color: #ac20da;
    border: 1px solid #ac20da;
    background: #fff;
  }

  .CBtn .MoveTop:hover {
    background: #ac20da;
    color: #fff;
  }

  .CBtn .MoveBottom {
    /* background: #20afdaba; */
    color: #20afda;
    border: 1px solid #20afda;
    background: #fff;
  }

  .CBtn .MoveBottom:hover {
    background: #20afda;
    color: #fff;
  }

  .CBtn .hiddenMove {
    background: #d4d4d4 !important;
    cursor: not-allowed;
    border: 1px solid #d4d4d4 !important;
    color: #fff;
  }
</style>